#ifndef VSUSERSAMPLER_H
#define VSUSERSAMPLER_H
#include "VSMemManager.h"
#include "VSMath.h"
#include "VSObject.h"
#include "VSTexAllState.h"
namespace VSEngine2
{
	class VSStream;
	class VSGRAPHIC_API VSUserSampler : public VSObject
	{
		//PRIORITY
		
		//RTTI
		DECLARE_RTTI;
		DECLARE_INITIAL
	public:
		virtual unsigned int DiskUse()const;

		virtual bool Save(VSStream & rStream,unsigned int &iSaveUse)const;
		virtual bool Load(VSStream & rStream,unsigned int &iSaveUse);
	public:
		virtual bool Clone(const VSObject *pObject,unsigned int uiType);

	public:
		
		VSUserSampler(const VSUsedName & Name,unsigned int uiTexType,unsigned int uiRegisterIndex);
		virtual ~VSUserSampler();

		inline unsigned int GetTexType()const
		{
			return m_uiTexType;
		}
		
		inline VSTexAllState * GetTex()const
		{
			return m_pTexture;
		}
		inline const VSUsedName & GetName()const
		{
			return m_Name;
		}
		inline void SetTex(VSTexAllState * pTex)
		{
			m_pTexture = pTex;
		}
		inline unsigned int GetRegisterIndex()const
		{
			return m_uiRegisterIndex;
		}
	protected:
		friend class VSRenderer;
		VSUserSampler();
	private:

		unsigned int m_uiTexType;
		VSTexAllStatePtr m_pTexture;
		VSUsedName		m_Name;
		unsigned int m_uiRegisterIndex;
	};
	VSTYPE_MARCO(VSUserSampler);
	DECLARE_Ptr(VSUserSampler);
}
#endif